import { createRouter, createWebHashHistory } from 'vue-router';
import LoginVue from '../pages/Login.vue';
// import NavPage from '../pages/NavPage.vue';
import Reg from '../pages/Reg.vue';
import Nav from '../pages/NavPage.vue'
import Home from '../pages/Home.vue'
import Role from '../pages/system/Role.vue'
import Menu from '../pages/system/Menu.vue'
import User from '../pages/system/User.vue'
import Dept from '../pages/system/Dept.vue'
import Dict from '../pages/system/Dict.vue'
import Profile from '../pages/Profile.vue'
import Goods from '../pages/gen/Goods.vue'
import Goodstype from '../pages/gen/Goodstype.vue'
import Online from '../pages/monitor/online.vue'
import Systemlog from '../pages/monitor/systemlog.vue'
import Info from '../pages/monitor/info.vue'
import Httptrace from '../pages/monitor/httptrace.vue'

export const router = createRouter({
    history: createWebHashHistory(),//路由导航模式为hash模式
    //路由的具体配置
    routes: [
        {
            path: "/",
            redirect: "/login"
        },
        {
            path: "/login",
            component: LoginVue,
        },
        {
            path: "/reg",
            component: Reg,
        },
        {
            path: "/system",
            component: Nav,
            children: [
                {
                    path: "home",
                    component: Home,
                },
                {
                    path: "role",
                    component: Role,
                },
                {
                    path: "user",
                    component: User,
                },
                {
                    path: "menu",
                    component: Menu,
                },
                {
                    path: "dept",
                    component: Dept,
                },
                {
                    path: "dict",
                    component: Dict,
                },
                {
                    path: "profile",
                    component: Profile,
                },
                {
                    path: "goods",
                    component: Goods,
                },
            ]
        },
        {
            path: "/gen",
            component: Nav,
            children: [
                {
                    path: "goods",
                    component: Goods,
                },
                {
                    path: "goodstype",
                    component: Goodstype,
                },
            ]
        },
        {
            path: "/monitor",
            component: Nav,
            children: [
                {
                    path: "online",
                    component: Online,
                },
                {
                    path: "systemlog",
                    component: Systemlog,
                },
                {
                    path: "redis/info",
                    component: Info,
                },
                {
                    path: "httptrace",
                    component: Httptrace,
                },
            ]
        },
    ]
});